﻿package com.boyaa.shells.tool 
{
	import gs.TweenData;
	import gs.TweenLite;
	
	/**
	 * ...
	 * @author fly
	 */
	public class GameTween 
	{
		
		public function GameTween(single:Single)
		{
			
		}
		
		/**
		 * 弹性缓动
		 * @param	obj
		 */
		public function elasticTween(obj:Object):void
		{
			obj.scaleX = obj.scaleY = 0;
			var data:TweenData = new TweenData("scaleX" , 1.1, "scaleY" , 1.1);
			data.onComplete = function ():void {
									tweenComplete(obj);
										};
			data.onCompleteParams = [];
			TweenLite.to(obj, 0.25, data);
		}
		
		private function tweenComplete(obj:Object):void
		{
			TweenLite.to(obj, 0.1, {scaleX : 1, scaleY: 1} );
		}
		
		/**
		 * 单例引用
		 */
		public static function get instance():GameTween
		{
			if(_instance == null)
			{
				_instance = new GameTween(new Single());
			}
			return _instance;
		}
		
		private static var _instance:GameTween = null;
	}
	
}
class Single{}